﻿namespace XUCore.WeChat.Enterprise.Net.ServerMessages.From
{
    using Newtonsoft.Json;
    using System.Collections.Generic;
    using System.Xml.Serialization;
    using XUCore.WeChat.Net.ServerMessages.From;

    /// <summary>
    /// 【企业微信】扫码推事件且弹出“消息接收中”提示框的事件推送
    /// </summary>
    [XmlRoot("xml")]
    public class FromScanCodeWaitmsgEvent : FromEventBase
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="FromScanEvent"/> class.
        /// </summary>
        public FromScanCodeWaitmsgEvent()
        {
            Event = FromEventTypes.scancode_waitmsg;
        }

        /// <summary>
        /// Gets or sets the EventKey
        /// 事件KEY值，qrscene_为前缀，后面为二维码的参数值
        /// </summary>
        public string EventKey { get; set; }

        /// <summary>
        /// 扫描信息
        /// </summary>
        [XmlElement("ScanCodeInfo")]
        public ScanCodeInfo ScanCode { get; set; }

        /// <summary>
        /// 异步任务
        /// </summary>
        public class ScanCodeInfo
        {
            /// <summary>
            /// 扫描类型，一般是qrcode
            /// </summary>
            /// <value></value>
            [XmlElement("ScanType")]
            public string ScanType { get; set; }
            /// <summary>
            ///扫描结果，即二维码对应的字符串信息
            /// </summary>
            /// <value></value>
            [XmlElement("ScanResult")]
            public string ScanResult { get; set; }
        }
    }
}
